package yunhe.servlet;

import yunhe.biz.ISaleBiz;
import yunhe.biz.impl.SaleBizImpl;
import yunhe.entity.SaleAppend;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * Created by Administrator on 2017/6/20.
 */
@WebServlet(name = "SaleBackExcuteServlet",urlPatterns = "/sale/SaleBackExcuteServlet")
public class SaleBackExcuteServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        ISaleBiz iSaleBizImpl = new SaleBizImpl();
        String cusId=request.getParameter("cusId");
        int flag1 = iSaleBizImpl.saleBackQuantityAlterByCus(cusId);
        int flag2 = iSaleBizImpl.saleBackStateAlterByCus(cusId);

        if (flag1 != 0 && flag2 !=0) {
            System.out.println("退货成功");
            response.getWriter().print(flag1);
        }

    }
}
